/*
 * @Author: WangRui
 * @Date: 2019-12-07 13:17:44
 * @LastEditors: WangRui
 * @LastEditTime: 2019-12-07 16:07:56
 * @Description: 使用react-loadable实现组件懒加载，可配置过场页面
 */
import React from 'react'
import Loadable from 'react-loadable';

//通用的过场组件
const loadingComponent = () => {
    return (
        <div>loading</div>
    )
}

//过场组件默认采用通用的，若传入了loading，则采用传入的过场组件
export default (loader, loading = loadingComponent) => {
    return Loadable({
        loader,
        loading
    })
}